from django.urls import path
from .views import right
from .views import user
from .views import captcha
from .views import dept
from .views import logs
from .views import role
from .views import LoginView,IndexView,AnalysisView,UserView,RoleView,LogsView,ConsoleView,PowerView

urlpatterns = [
    # 前端视图
    path('', LoginView.as_view(), name='login'),
    path('index',IndexView.as_view(), name='index'),
    path('analysis',AnalysisView.as_view(), name='analysis'),
    path('user',UserView.as_view(), name='user'),
    path('role',RoleView.as_view(), name='role'),
    path('logs',LogsView.as_view(), name='logs'),
    path('console',ConsoleView.as_view(),name= 'console'),
    path('power',PowerView.as_view(), name='power'),

    # 服务端逻辑视图
    path('api/login', right.LoginUserView.as_view(), name='loginApi'),
    path('api/logout', right.LoginOutView.as_view(), name= 'logoutApi'),
    path('api/right', right.RightView.as_view(), name='rightApi'),
    path('api/rightList', right.RightListView.as_view(), name='rightListApi'),
    path('api/captcha', captcha.CaptchaView.as_view(), name='captchaApi'),
    path('api/power', right.PowerView.as_view(), name='powerApi'),
    path('api/users', user.UsersView.as_view(), name='usersApi'),
    path('api/dept', dept.DeptView.as_view(), name='deptApi'),
    path('api/logs',logs.LogView.as_view(), name= 'logsApi'),
    path('api/role',role.RoleListView.as_view(), name= 'roleApi'),
]